import request from '@/utils/request'

// 获取社团列表
export function getSociety () {
  return request({
    url: 'index',
    method: 'get'
  })
}

// 获取社团详细信息
export function getSocietyInfo (data) {
  return request({
    url: 'society/index/getSocietyInfoBySid',
    method: 'post',
    data
  })
}

// 获取活动列表
export function getActivityList (data) {
  return request({
    url: 'activity/operate/getActivityListBySid',
    method: 'get',
    params: data
  })
}

// 获取活动详情
export function getActivity (data) {
  return request({
    url: 'activity/index/getActivityByAid',
    method: 'get',
    params: data
  })
}

// 获取加入人名单
export function getJoinListByAid (data) {
  return request({
    url: 'activity/index/getJoinListByAid',
    method: 'post',
    data
  })
}

// 是否管理员
export function isManager (data) {
  return request({
    url: 'society/operate/isManagerBySid',
    method: 'post',
    data
  })
}

// 退出活动
export function outActivity (data) {
  return request({
    url: 'activity/operate/outActivityByAid',
    method: 'post',
    data
  })
}

// 加入活动
export function joinActivity (data) {
  return request({
    url: 'activity/operate/joinActivityByAid',
    method: 'post',
    data
  })
}

// 检验活动和状态
export function activityState (data) {
  return request({
    url: 'activity/operate/getUserAndActivityState',
    method: 'post',
    data
  })
}

// 微信分享
export function wxShare (data) {
  return request({
    url: 'system/wx/GetSignPackage',
    method: 'post',
    data
  })
}

// 获取store
export function getStore (data) {
  return request({
    url: 'store/operate/getAllStore',
    method: 'get',
    params: data
  })
}

// 加入社团
export function joinSociety (data) {
  return request({
    url: 'society/operate/joinSocietyBySid',
    method: 'post',
    data
  })
}

// 获取社团列表
export function getSocietyList (data) {
  return request({
    url: 'society/index/getSocietyList',
    method: 'get',
    params: data
  })
}
// 获取社团相关信息
export function getSocietyLogoAndInfo (data) {
  return request({
    url: 'society/operate/getSocietyLogoAndInfoBySid',
    method: 'post',
    data
  })
}

// 根据aid发送邮件
export function sendEmailByAid (data) {
  return request({
    url: 'system/email/sendEmailByAid',
    method: 'post',
    data
  })
}

// 邮件群发
export function sendEmail (data) {
  return request({
    url: 'system/email',
    method: 'post',
    data
  })
}

// 发送短信
export function sendSms (data) {
  return request({
    url: 'system/sms',
    method: 'post',
    data
  })
}

// 获取成员列表
export function getMemberList (data) {
  return request({
    url: 'society/index/getMemberListBySidAndStatus',
    method: 'post',
    data
  })
}

// 获取社团成员详细信息
export function getSocietyUser (data) {
  return request({
    url: 'society/operate/getUserInfoBySidAndUid',
    method: 'post',
    data
  })
}

// 同意加入社团
export function agree (data) {
  return request({
    url: 'society/operate/agree',
    method: 'post',
    data
  })
}

// 創建活動
export function addActivity (data) {
  return request({
    url: 'activity/operate/addOneActivity',
    method: 'post',
    data
  })
}

// 刪除活動
export function delActivity (data) {
  return request({
    url: 'activity/operate/delActivityByAid',
    method: 'post',
    data
  })
}

// 修改活動
export function editActivity (data) {
  return request({
    url: 'activity/operate/updateActivityByAid',
    method: 'post',
    data
  })
}
